#pragma once
#include "Matrix.h"
#include "CoordSys.h"
#include "GNSSSatPos.h"
#include "IonoCorr.h"
#include "TropCorr.h"
#include "ReadO.h"
#include "ReadN.h"
#include "TimeSys.h"

class Spp {
public:
    Spp(CoordSys* cs, GNSSSatPos* satPos, IonoCorr* iono, TropCorr* trop, ReadO* readO, ReadN* readN, TimeSys* ts);
    bool processEpoch(int epochIndex, XYZ& resultPos, double& clkErr);

private:
    CoordSys* mCoordSys;
    GNSSSatPos* mSatPos;
    IonoCorr* mIonoCorr;
    TropCorr* mTropCorr;
    ReadO* mReadO;
    ReadN* mReadN;
    TimeSys* mTimeSys;
    const double SPEED_OF_LIGHT = 299792458.0;
    const int MAX_ITERATIONS = 10;
    const double CONVERGENCE_THRESHOLD = 0.1; // meters
};